<%--
  Created by IntelliJ IDEA.
  User: yangkai
  Date: 2016/2/14
  Time: 10:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>学生档案管理</title>
    <link rel="stylesheet" type="text/css" href="/static/themes/icon.css" />
    <link rel="stylesheet" type="text/css" href="/static/themes/default/easyui.css" />
    <script type="text/javascript" src="/static/jquery.min.js"></script>
    <script type="text/javascript" src="/static/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="/static/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="/static/my-util.js"></script>
</head>
<body>
<table id="studentRecord-table"></table>
<div id="studentRecord-table-tool">
    <a id="导入" href="#" class="easyui-linkbutton" data-options="plain:true">导入</a>
    <a id="导出" href="#" class="easyui-linkbutton" data-options="plain:true">导出</a>
    <a id="新增" href="#" class="easyui-linkbutton" data-options="plain:true">新增</a>
    <a id="删除" href="#" class="easyui-linkbutton" data-options="plain:true">删除</a>
    <input id="ss"  />
    <div id="mm">
        <div data-options="name:'all'">请选择</div>
        <div data-options="name:'grade'">班级</div>
        <div data-options="name:'name'">姓名</div>
        <div data-options="name:'phone'">联系方式</div>
        <div data-options="name:'classTeacher'">班主任</div>
        <div data-options="name:'address'">地址</div>
        <div data-options="name:'education'">学历</div>
    </div>
</div>
<div id="studentRecord-import-dialog"></div>
<script type="text/javascript">
    $('#studentRecord-table').datagrid({
        url:'studentRecord.json',
        columns:[[
            {title:'档案编号',field:'recordNum'},
            {title:'姓名',field:'student_name'},
            {title:'拼音',field:'student_namespell'},
            {title:'性别',field:'gender'},
            {title:'班级',field:'grade'},
            {title:'班主任',field:'classTeacher'} ,
            {title:'联系方式',field:'phone'},
            {title:'所学产品',field:'productCode'},
            {title:'学历',field:'education'},
            {title:'地址',field:'address'},
            {title:'身份证号',field:'idcard'}

        ]],
        pagination:true,
        rownumbers:true,
        toolbar:'#studentRecord-table-tool'

    });
    $('#ss').searchbox({
        searcher:function(value,name){
            $('#studentRecord-table').datagrid({
                queryParams: {
                    'name': name,
                    'value': value
                }


            });
        },
        menu:'#mm',
        prompt:'请输入值'
    });
    $('#studentRecord-import-dialog').dialog({
        title: '导入学员信息',
        width: 400,
        height: 200,
        closed: true,
        cache: false,
        href: '/school/studentRecord/importxls.do'

    });
    $('#导入').click(function(){

        $('#studentRecord-import-dialog').dialog("open");

    });
    $('#导出').click(function(){

        var form=$("<form>");//定义一个form表单
        form.attr("style","display:none");
        form.attr("method","post");
        form.attr("action","/school/studentRecord/exportXlsByParam.do");
        var input1=$("<input>");
        input1.attr("type","hidden");
        input1.attr("name",'name');
        input1.attr("value",$('#ss').searchbox('getName'));
        var input2=$("<input>");
        input2.attr("type","hidden");
        input2.attr("name",'value');
        input2.attr("value",$('#ss').searchbox('getValue'));
        $("body").append(form);//将表单放置在web中
        form.append(input1);
        form.append(input2);

        form.submit();

    });
</script>

</body>
</html>
